package com.cn.aam.checaiduo.base.web;

import android.content.Context;
import android.content.Intent;
import android.view.View;
import android.widget.LinearLayout;

import com.alibaba.android.arouter.facade.annotation.Route;
import com.cn.aam.checaiduo.Const;
import com.cn.aam.checaiduo.R;
import com.cn.aam.checaiduo.base.ToolBarManager;

import butterknife.BindView;

/**
 * 专门显示banner的activity
 */
@Route(path = "/web/redToolBar", name = "红色标题栏webview", group = "web")
public class RedToolbarWebActivity extends BaseWebActiivity {


    public static Intent newInstance(Context context, String targetUrl, String targetTitle) {
        Intent i = new Intent(context, RedToolbarWebActivity.class);
        i.putExtra(Const.TARGET_URL, targetUrl);
        i.putExtra(Const.TARGET_TITLE, targetTitle);
        return i;
    }


    @Override
    protected void initView() {
        super.initView();
        //默认使用fitSystemWindow  此处无交互，所以不需要
        linBackground.setFitsSystemWindows(false);
    }

    @Override
    protected void initToolBar() {
        ToolBarManager.with(this, WMContent)
                .setBackgroundColor(R.color.colorPrimary)
                .setLeftMenuIconRes(R.drawable.ic_nav_arrow_white)
                .setLeftMenuIconClickListener(new View.OnClickListener() {
                    @Override
                    public void onClick(View v) {
                        onBackPressed();
                    }
                })
                .setTitle(targetTitle)
                .setTitleColor(R.color.white);
    }

}
